package com.yingdong.db;

import com.yingdong.annotation.PrimeKey;
import com.yingdong.annotation.AutoIncrease;
import java.util.ArrayList;
import java.util.List;

public class User extends DBObject{
    
    private static List<User> delList=new ArrayList<>();
   
	private static User instance;

    /**
	 * 
	 */
	@PrimeKey
	@AutoIncrease
    private Integer id;
    
    /**
	 * 帐号id
	 */
	
	
    private Integer accId;
    
    /**
	 * 角色名
	 */
	
	
    private String userName;
    
    /**
	 * 性别
	 */
	
	
    private Integer gender;
    
    /**
	 * 上次登录时间
	 */
	
	
    private Integer lastLoginDttm;
    
    /**
	 * 建立角色时间
	 */
	
	
    private Integer createDttm;
    
 

    public Integer getId() {
	    return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
		changeDBStatus();
	}

    public Integer getAccId() {
	    return accId;
	}
	
	public void setAccId(Integer accId) {
		this.accId = accId;
		changeDBStatus();
	}

    public String getUserName() {
	    return userName;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
		changeDBStatus();
	}

    public Integer getGender() {
	    return gender;
	}
	
	public void setGender(Integer gender) {
		this.gender = gender;
		changeDBStatus();
	}

    public Integer getLastLoginDttm() {
	    return lastLoginDttm;
	}
	
	public void setLastLoginDttm(Integer lastLoginDttm) {
		this.lastLoginDttm = lastLoginDttm;
		changeDBStatus();
	}

    public Integer getCreateDttm() {
	    return createDttm;
	}
	
	public void setCreateDttm(Integer createDttm) {
		this.createDttm = createDttm;
		changeDBStatus();
	}
 
 	public static User getInstance() {
		if (instance == null)
			instance = new User();
		return instance;
	}
 
    @Override
    public String getSelectByKeyString(){
    	String sql="SELECT * FROM User WHERE 1=1  AND id=? ";
        return sql;
    }
    
    @Override
    public String getUpdateByKeyString(){
    	String sql="UPDATE  User SET    accId=?,  userName=?,  gender=?,  lastLoginDttm=?,  createDttm=?    WHERE 1=1   AND id=?";
        return sql;
    }
    
    @Override
    public String getSelectAllObjectsString(){
    	String sql="SELECT * FROM User ";
        return sql;
    }
    
    @Override
    public String getDelObjectKeyString(){
    	String sql="DELETE  FROM User WHERE 1=1   AND id=?";
        return sql;
    }
    
    @Override
    public String getSelectAllObjectsKeyString(){
    	String sql="SELECT * FROM User WHERE 1=1   AND id=?";
        return sql;
    }
    
    
    @Override
	public String getTableName(){
	   return "User";
	}

}